﻿using System;
using System.Collections.Generic;
using WPTrek.Data.Space;

namespace WPTrek.Data.Stub
{
    public class StubSectorFactory : ISectorFactory
    {
        public int SectorsCount { get; private set; }

        public IGalaxy Galaxy { get; private set; }

        public StubSectorFactory(int sectorsCount, IGalaxy galaxy)
        {
            SectorsCount = sectorsCount;
            Galaxy = galaxy;
        }

        #region ISectorFactory Members

        public IEnumerable<ISector> Create()
        {
            List<ISector> result = new List<ISector>();

            for (int i = 0; i < SectorsCount; ++i)
            {
                var sector = new Sector(Guid.NewGuid(), 0, 0, Galaxy.Name + i.ToString(), Galaxy);
                result.Add(sector);
            }

            return result;
        }

        #endregion
    }
}
